package com.fdd.op.demo;

import com.fdd.op.sdk.ApiException;
import com.fdd.op.sdk.DefaultFddClient;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.token.FddTokenStore;
import com.fdd.op.sdk.internal.token.stroe.CacheTokenStoreImpl;
import com.fdd.op.sdk.internal.util.json.JSONWriter;
import com.fdd.op.sdk.request.api.account.GetAccountRequest;
import com.fdd.op.sdk.request.api.contract.GetDocListByContractIdRequest;
import com.fdd.op.sdk.request.api.contract.manual.GetSignUrlRequest;
import com.fdd.op.sdk.response.api.account.GetAccountResponse;
import com.fdd.op.sdk.response.api.contract.GetDocListByContractIdResponse;
import com.fdd.op.sdk.response.api.contract.manual.GetSignUrlResponse;

/**
 *
 */
public class GetSignUrlApi {
    private static String serverUrl = "http://10.21.8.20:37801";
    private static final String appId = "486478";
    private static final String appKey = "xguUMVFnDzqJgfVEDnLW16yE2mxVL2Fp";

    public static void main(String[] args) throws ApiException {
        FddTokenStore tokenStore = new CacheTokenStoreImpl();
        DefaultFddClient fddClient = new DefaultFddClient(serverUrl, appId, appKey, Constants.SIGN, 1000, 30000);
        fddClient.tokenStore(tokenStore);
        GetSignUrlRequest request = new GetSignUrlRequest();
        request.setDocId("382958617431142400");
        request.setNotifyNo("2023112330");
        request.setSignerAccountId("367723604385890304");
        GetSignUrlResponse response = fddClient.execute(request);
        if(response != null && "0".equals(response.getCode())){
            System.out.println(response.getData());
        }
    }
}
